package com.oren.Thread.study.day01;

/**
 * Created by IntelliJ IDEA.
 * User: wangshiwei
 * Date: 2018/8/3
 * Time: 13:33
 * describe: 线程不共享
 */
public class Demo2 extends Thread {

    private int count=5;

    public Demo2(String name){
        super();
        this.setName(name); //设置线程的名称
    }

    @Override
    public  void run(){
        super.run();
        while(count>0){
            count--;
            System.out.println("由"+this.currentThread().getName()+"计算，count ="+count);
        }
    }
}
